package com.mrptech.mess.model;

// Generated Feb 15, 2015 10:58:50 PM by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * UserLogonAudit generated by hbm2java
 */
@Entity
@Table(name = "USER_LOGON_AUDIT")
public class UserLogonAudit implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private UserLogonAuditId id;
	private Users users;
	private String userId;
	private Date logonTime;
	private Date logoffTime;
	private BigDecimal ipAddress;
	private BigDecimal osuser;

	public UserLogonAudit() {
	}

	public UserLogonAudit(UserLogonAuditId id, Users users) {
		this.id = id;
		this.users = users;
	}

	public UserLogonAudit(UserLogonAuditId id, Users users, String userId,
			Date logonTime, Date logoffTime, BigDecimal ipAddress,
			BigDecimal osuser) {
		this.id = id;
		this.users = users;
		this.userId = userId;
		this.logonTime = logonTime;
		this.logoffTime = logoffTime;
		this.ipAddress = ipAddress;
		this.osuser = osuser;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "logonAuditId", column = @Column(name = "LOGON_AUDIT_ID", nullable = false, precision = 22, scale = 0)),
			@AttributeOverride(name = "accountId", column = @Column(name = "ACCOUNT_ID", nullable = false, precision = 22, scale = 0)) })
	public UserLogonAuditId getId() {
		return this.id;
	}

	public void setId(UserLogonAuditId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ACCOUNT_ID", nullable = false, insertable = false, updatable = false)
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@Column(name = "USER_ID", length = 30)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "LOGON_TIME", length = 7)
	public Date getLogonTime() {
		return this.logonTime;
	}

	public void setLogonTime(Date logonTime) {
		this.logonTime = logonTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "LOGOFF_TIME", length = 7)
	public Date getLogoffTime() {
		return this.logoffTime;
	}

	public void setLogoffTime(Date logoffTime) {
		this.logoffTime = logoffTime;
	}

	@Column(name = "IP_ADDRESS", precision = 22, scale = 0)
	public BigDecimal getIpAddress() {
		return this.ipAddress;
	}

	public void setIpAddress(BigDecimal ipAddress) {
		this.ipAddress = ipAddress;
	}

	@Column(name = "OSUSER", precision = 22, scale = 0)
	public BigDecimal getOsuser() {
		return this.osuser;
	}

	public void setOsuser(BigDecimal osuser) {
		this.osuser = osuser;
	}

}
